﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using A2DFramework.CacheService.CacheProvider.LocalCache;

namespace A2DFramework.CacheService
{
    class TimeHelper
    {
        public static DateTime CalculateExpirationDateTime(CacheExpireType expireType, double increment)
        {
            if (expireType == CacheExpireType.Absolutely)
                return DateTime.Now.AddSeconds(increment);
            else if (expireType == CacheExpireType.Forever)
                return DateTime.Now.AddDays(7);
            else if (expireType == CacheExpireType.Slide)
                return DateTime.Now.AddDays(7);

            return DateTime.Now.AddDays(7);
        }
    }
}
